package com.hmyuan.controller.back;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hmyuan.domain.Comment;
import com.hmyuan.service.CommentService;

/**
 * 评论留言Controller
 * @author wbtianhl
 *
 */
@Controller
@RequestMapping("/back/comment")
public class CommentController {
	
	@Resource
	CommentService commentService;
	/**
	 * 评论留言管理页面
	 */
	@RequestMapping("/commentPage")
	public String commentPage(HttpServletRequest request,Model model){
		return "/back/comment/commentPage";
	}
	/**
	 * 分页查询评论留言列表
	 */
	@RequestMapping("/findcommentList")
	public String findcommentList(HttpServletRequest request,Model model,Integer pageNum,Comment comment){
		if(pageNum==null) pageNum=1;
		request.setAttribute("pageInfo", commentService.selectListByPage(comment, pageNum, 10));
		return "/back/comment/commentPageList";
	}
}
